package com.wc.alorithm_blue_bridge_history.littlewhite.Q240113.Q12116;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/1/13 19:29
 * @description 怪兽突击
 * https://www.lanqiao.cn/problems/12116/learning/?contest_id=160
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int maxN = (int) 1e5 + 7;
    static long sum = 0;
    static int[] a = new int[maxN];
    static int[] b = new int[maxN];
    static int n, k;

    public static void main(String[] args) {
        n = sc.nextInt();
        k = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            a[i] = sc.nextInt();
        }
        for (int i = 1; i <= n; i++) {
            b[i] = sc.nextInt();
        }
        long mm = (long) 1e14;
        long res = (long) 1e14;
        long last = Math.min(n, k);
        for (int i = 1; i <= last; i++) {
            sum += a[i];
            mm = Math.min(mm, a[i] + b[i]);
            res = Math.min(res, sum + (k - i) * mm);
        }
        out.println(res);
        out.flush();
    }

}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }
}
